<?php
include("connection/connection.php");
$formId=$_REQUEST['frmId'];
if(isset($_POST['submit']))
{
		$fclick = true;
		$loc_id = $_SESSION['loc_id'];
		$current_status=$_POST['current_status'];
		$actual_water_supply=$_POST['actual_water_supply'];
		$frequency_supply=$_POST['frequency_supply'];
		$duration_of_supply=$_POST['duration_of_supply'];
		if($_POST['type_of_disinfection']!='Other')
		{
			$type_of_disinfection=$_POST['type_of_disinfection'];
		}
		else
		{
			$type_of_disinfection=$_POST['type_other'];
		}
		$disinfection_frequecy=$_POST['disinfection_frequecy'];
		$Quantity_of_chemical=$_POST['Quantity_of_chemical'];
		$manpower_o_m=$_POST['manpower_o_m'];
		$tech_emp=$_POST['tech_emp'];
		$exist_water_supplied=$_POST['exist_water_supplied'];
		$exist_water_supplied=implode(',',$exist_water_supplied);
		$water_connection_domestic=$_POST['water_connection_domestic'];
		$water_connection_nondomestic=$_POST['water_connection_nondomestic'];
		$water_connection_industrial=$_POST['water_connection_industrial'];
		$domestic=$_POST['domestic'];
		$non_domestic=$_POST['non_domestic'];
		$industrial=$_POST['industrial'];
		$wbr_09_10=$_POST['wbr_09_10'];
		$wbr_08_09=$_POST['wbr_08_09'];
		$wbr_07_08=$_POST['wbr_07_08'];
		$rg_09_10=$_POST['rg_09_10'];
		$rg_08_09=$_POST['rg_08_09'];
		$rg_07_08=$_POST['rg_07_08'];
		$mpc_fy_09_10=$_POST['mpc_fy_09_10'];
		$mpc_fy_08_09=$_POST['mpc_fy_08_09'];
		$mpc_fy_07_08=$_POST['mpc_fy_07_08'];
		$mcmr_fy_09_10=$_POST['mcmr_fy_09_10'];
		$mcmr_fy_08_09=$_POST['mcmr_fy_08_09'];
		$mcmr_fy_07_08=$_POST['mcmr_fy_07_08'];
		$mcpr_fy_09_10=$_POST['mcpr_fy_09_10'];
		$mcpr_fy_08_09=$_POST['mcpr_fy_08_09'];
		$mcpr_fy_07_08=$_POST['mcpr_fy_07_08'];
		$pc_fy_09_10=$_POST['pc_fy_09_10'];
		$pc_fy_08_09=$_POST['pc_fy_08_09'];
		$pc_fy_07_08=$_POST['pc_fy_07_08'];
		$cc_fy_09_10=$_POST['cc_fy_09_10'];
		$cc_fy_08_09=$_POST['cc_fy_08_09'];
		$cc_fy_07_08=$_POST['cc_fy_07_08'];
		$prev_main_mech_place=$_POST['prev_main_mech_place'];
		$exist_report_sys=$_POST['exist_report_sys'];
		$report_other=$_POST['report_other'];
		$exist_report_sys=implode(',',$exist_report_sys); 
		$exist_report_sys=$exist_report_sys . $report_other;
		/*if($_POST['exist_report_sys']!='Other')
		{
			$exist_report_sys=$_POST['exist_report_sys'];
		}
		else
		{
			$exist_report_sys=$_POST['report_other'];
		}*/
		$time_taken=$_POST['time_taken'];
		$complaint_1=$_POST['complaint_1']; 
		$complaint_2=$_POST['complaint_2'];
		$complaint_3=$_POST['complaint_3'];
		$complaint_4=$_POST['complaint_4'];
		$complaint_5=$_POST['complaint_5'];
		$institutional=$_POST['institutional'];
		$institutional_other=$_POST['institutional_other'];
		$institutional=implode(',',$institutional); 
		$institutional=$institutional . $institutional_other;
		$financial=$_POST['financial'];
		$financial_other=$_POST['financial_other'];
		$financial=implode(',',$financial); 
		$financial=$financial . $financial_other;
		$operational=$_POST['operational'];
		$operational_other=$_POST['operational_other'];
		$operational=implode(',',$operational); 
		$operational=$operational . $operational_other;
		
		$qr1="UPDATE tbl_dtls_q1_last SET current_status='$current_status', water_supply='$actual_water_supply', freq_supply='$frequency_supply', duration_supply='$duration_of_supply', type_disinfection='$type_of_disinfection', freq='$disinfection_frequecy', quant_chemical='$Quantity_of_chemical', manpwr_total='$manpower_o_m', tech_emp='$tech_emp', existing_means='$exist_water_supplied', domestic_no='$water_connection_domestic', nondomestic_no='$water_connection_nondomestic', industrial_no='$water_connection_industrial', domestic_system='$domestic', nondomestic_system='$non_domestic', industrial_system='$industrial', wbs_9_10='$wbr_09_10', wbs_8_9='$wbr_08_09', wbs_7_8='$wbr_07_08', rg_9_10='$rg_09_10', rg_8_9='$rg_08_09', rg_7_8='$rg_07_08', mpc_9_10='$mpc_fy_09_10', mpc_8_9='$mpc_fy_08_09', mpc_7_8='$mpc_fy_07_08',mc_mr_9_10='$mcmr_fy_09_10', mc_mr_8_9='$mcmr_fy_08_09', mc_mr_7_8='$mcmr_fy_07_08', mc_pr_9_10='$mcpr_fy_09_10', mc_pr_8_9='$mcpr_fy_08_09', mc_pr_7_8='$mcpr_fy_07_08', pc_9_10='$pc_fy_09_10', pc_8_9='$pc_fy_08_09', pc_7_8='$pc_fy_07_08', cc_9_10='$cc_fy_09_10', cc_8_9='$cc_fy_08_09', cc_7_8='$cc_fy_07_08', preventive_place='$prev_main_mech_place', existing_report='$exist_report_sys', time_taken='$time_taken', complaint_1='$complaint_1', complaint_2='$complaint_2', complaint_3='$complaint_3', complaint_4='$complaint_4', complaint_5='$complaint_5', institutional='$institutional', financial='$financial', operational='$operational' WHERE loc_id=$formId";
		//echo $qr1;exit;
		$result1=mysql_query($qr1);
			if($result1)
			{
				
				header('Location: q1_rwss_edit.php');
			}
}
?>		
